﻿<%@ Page Language="C#" MasterPageFile="~/first.master" AutoEventWireup="true" CodeFile="index.aspx.cs"
    Inherits="data_index" Title="数据订购" %>

<asp:Content ID="Content1" ContentPlaceHolderID="headPlaceHolder" runat="Server">
    <link href="../css/jPaginate/css/style.css" rel="stylesheet" type="text/css" />
    <link href="../css/flick/jquery-ui-1.8.21.custom.css" rel="stylesheet" type="text/css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="contentPlaceHolder" runat="Server">
    <div class="leftbar">
        <div class="left_top_bg">
        </div>
        <div class="left_nav">
            <div class="left_nav_top">
            </div>
            <div class="left_nav_middle">
                <div id="leftbar_head_solutions" class="databar_head" onclick="toggleLeftBody('solutions')">
                    地理背景数据(98)
                </div>
                <div id="leftbar_body_solutions" class="leftbar_body">
                </div>
                <div id="leftbar_head_systemproduct" class="databar_head" onclick="toggleLeftBody('systemproduct');">
                    自然资源数据(47)
                </div>
                <div id="leftbar_body_systemproduct" class="leftbar_body">
                </div>
                <div id="leftbar_head_dataproduct" class="databar_head" onclick="toggleLeftBody('dataproduct')">
                    遥感影像数据(55)
                </div>
                <div id="leftbar_body_dataproduct" class="leftbar_body">
                </div>
            </div>
            <div class="left_nav_bottom">
            </div>
        </div>
        <div class="left_show_block">
            <div class="left_show_head">
                <div class="column_title">
                    销售咨询
                </div>
            </div>
            <div id="leftbar_saleshelp" class="left_show_body" style="font-size: 12px;">
                <div class="pic_telephone">
                    电话：010-84896208</div>
                <div class="pic_email">
                    邮箱：service@dview.com.cn</div>
                <div class="pic_qq">
                    QQ：10034354353</div>
                <div class="pic_mobile">
                    手机：1862321212</div>
                <div class="pic_user">
                    联系人：沈斌斌</div>
                <br />
                <div class="pic_qq">
                    QQ：10034354353</div>
                <div class="pic_mobile">
                    手机：1862321212</div>
                <div class="pic_user">
                    联系人：李明</div>
            </div>
        </div>
    </div>
    <div class="mainBar">
        <div class="mainBar_head">
            <div class="mainBar_title">
                数据订购
            </div>
            <div class="mainBar_hind">
                <a href="../index.aspx">首页</a>>><a href="index.aspx">数据订购</a>
            </div>
        </div>
        <div class="mainBar_body">
            <ul id="datalist" class="secondList">
                <%
                    if (ds != null && ds.Tables[0].Rows.Count > 0)
                    {
                        int count = ds.Tables[0].Rows.Count;
                        for (int i = 0; i < count; i++)
                        {
                            System.Data.DataRow row = ds.Tables[0].Rows[i];
                %>
                <li>
                    <div class="main_title_container main_title_container_hot">
                        <div class="main_title_name">
                            <%= row["NAME"] %>
                        </div>
                        <div class="main_title_description">
                            应用领域：
                        </div>
                    </div>
                    <div class="main_content_container">
                        <div class="main_content_img">
                            <img src="../file/data/thumbnail/<%= row["IMAGE"]%>" />
                        </div>
                        <div class="main_content_description">
                            <%= row["SUMMARY"]%>
                        </div>
                        <div class="main_content_detail">
                            <a href="detail.aspx?id=<%= row["ID"]%>">[详细信息]</a>
                            <a onclick="" href="detail.aspx?id=<%= row["ID"]%>">[数据订购]</a>
                            <a href="javascript:collectData(<%= row["ID"]%>)">[数据收藏]</a>
                        </div>
                    </div>
                </li>
                <%
                    }
                    }
                %>
            </ul>
            <div class="mainBar_page">
                <div id="pagingDiv">
                </div>
            </div>
        </div>
        <div style="clear: both;">
        </div>
        <div id="dialog" title="提示">
        </div>
    </div>
    <div style="clear: both;">
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="javascriptPlaceHolder" runat="Server">

    <script src="../js/jquery.htmlanimation.js" type="text/javascript"></script>

    <script src="../js/jquery.paginate.js" type="text/javascript"></script>

    <script src="../js/jquery-ui-1.8.21.custom.min.js" type="text/javascript"></script>

    <script type="text/javascript">
    jQuery(document).ready(function() {
        $("#pagingDiv").paginate({
			count 		: <%=pageCount %>,
			start 		: <%=page %>,
			display     : 10,
			border					: true,
			border_color			: '#cbccd0',
			text_color  			: '#000000',
			background_color    	: '#ffffff',	
			border_hover_color		: '#ccc',
			text_hover_color  		: '#ffffff',
			background_hover_color	: '#de7a00', 
			images					: false,
			mouse					: 'press',
			onChange     			: function(page){
										window.location.href="index.aspx?page=" + page;
									  }
		});
		
		$( "#dialog" ).dialog({
			autoOpen: false,
			show: "blind",
			height:"100"
		});
    });
    
    function collectData(id){
            $.getJSON('collect.ashx?id=' + id,
            function(response) {
                if(response.collect){
                    $( "#dialog" ).html(response.data.info + "<a href='user/collect.aspx'>查看收藏夹</a>").dialog("open");
                }else{
                    if(response.data.isLogin){
                        $( "#dialog" ).html('请先登录').dialog("open");
                    }else{
                        $( "#dialog" ).html(response.data.info + "<a href='user/collect.aspx'>查看收藏夹</a>").dialog("open");
                    }
                }
            });
    }
    </script>

</asp:Content>
